from django.db import models
from django.db import models
import django.utils.timezone as timezone

class img(models.Model):
    id=models.AutoField('imgid',primary_key=True)
    img_path=models.CharField('图片路径',max_length=64,)
    img_tag=models.BigIntegerField('算法标记')
    img_data=models.CharField('算法值',max_length=64)
    image = models.ImageField(upload_to='images/%Y%m%d')
    datetime=models.DateTimeField('创建时间',auto_now=True)
    def get_pic(self):
        if self.pic:
            return self.pic
